<template>
  <div class="about-page">
    <div class="about-header">
      <div class="logo-section">
        <div class="logo">
          <img :src="logoPath" alt="GuLu Logo" class="logo-image" />
        </div>
        <h1>InfluxDB Client</h1>
        <p class="tagline">{{ $t('about.tagline') }}</p>
        <p class="version">{{ $t('about.version') }} 1.0.0</p>
      </div>
    </div>

    <div class="about-content">
      <el-card class="info-card">
        <h2><i class="el-icon-info"></i> {{ $t('about.title') }}</h2>
        <p>{{ $t('about.description') }}</p>
      </el-card>

      <el-card class="features-card">
        <h2><i class="el-icon-star-on"></i> {{ $t('about.features') }}</h2>
        <div class="features-grid">
          <div class="feature-item">
            <i class="el-icon-link"></i>
            <h3>{{ $t('about.connectionManagement') }}</h3>
            <p>{{ $t('about.connectionManagementDesc') }}</p>
          </div>
          <div class="feature-item">
            <i class="el-icon-files"></i>
            <h3>{{ $t('about.databaseExplorer') }}</h3>
            <p>{{ $t('about.databaseExplorerDesc') }}</p>
          </div>
          <div class="feature-item">
            <i class="el-icon-edit"></i>
            <h3>{{ $t('about.queryEditor') }}</h3>
            <p>{{ $t('about.queryEditorDesc') }}</p>
          </div>
          <div class="feature-item">
            <i class="el-icon-data-analysis"></i>
            <h3>{{ $t('about.dataVisualization') }}</h3>
            <p>{{ $t('about.dataVisualizationDesc') }}</p>
          </div>
          <div class="feature-item">
            <i class="el-icon-download"></i>
            <h3>{{ $t('about.dataExport') }}</h3>
            <p>{{ $t('about.dataExportDesc') }}</p>
          </div>
          <div class="feature-item">
            <i class="el-icon-time"></i>
            <h3>{{ $t('about.queryHistory') }}</h3>
            <p>{{ $t('about.queryHistoryDesc') }}</p>
          </div>
        </div>
      </el-card>

      <el-card class="tech-card">
        <h2><i class="el-icon-cpu"></i> {{ $t('about.techStack') }}</h2>
        <div class="tech-grid">
          <div class="tech-item">
            <strong>Frontend:</strong>
            <span>Vue.js 2.6 + Vue Router + Vuex</span>
          </div>
          <div class="tech-item">
            <strong>UI Framework:</strong>
            <span>Element UI</span>
          </div>
          <div class="tech-item">
            <strong>Desktop Framework:</strong>
            <span>Electron</span>
          </div>
          <div class="tech-item">
            <strong>Runtime:</strong>
            <span>Node.js 18</span>
          </div>
          <div class="tech-item">
            <strong>Charts:</strong>
            <span>ECharts</span>
          </div>
          <div class="tech-item">
            <strong>Code Editor:</strong>
            <span>CodeMirror</span>
          </div>
        </div>
      </el-card>

      <el-card class="support-card">
        <h2><i class="el-icon-service"></i> {{ $t('about.support') }}</h2>
        <div class="links-grid">
          <a href="https://gitee.com/Gulu_Lv/influx-db-cleint" target="_blank" class="link-item">
            <i class="el-icon-link"></i>
            <span>{{ $t('about.projectGithub') }}</span>
          </a>
          <a href="https://gitee.com/Gulu_Lv/influx-db-cleint" target="_blank" class="link-item">
            <i class="el-icon-link"></i>
            <span>{{ $t('about.projectGitee') }}</span>
          </a>
          <a href="https://docs.influxdata.com/influxdb/" target="_blank" class="link-item">
            <i class="el-icon-document"></i>
            <span>{{ $t('about.influxdbDocs') }}</span>
          </a>
          <a href="https://github.com/influxdata/influxdb" target="_blank" class="link-item">
            <i class="el-icon-link"></i>
            <span>{{ $t('about.influxdbGithub') }}</span>
          </a>
          <a href="https://community.influxdata.com/" target="_blank" class="link-item">
            <i class="el-icon-chat-dot-round"></i>
            <span>{{ $t('about.communityForum') }}</span>
          </a>
          <a href="https://www.influxdata.com/products/influxdb/" target="_blank" class="link-item">
            <i class="el-icon-info"></i>
            <span>{{ $t('about.officialWebsite') }}</span>
          </a>
        </div>
      </el-card>

      <div class="footer">
        <p>{{ $t('about.copyright') }}</p>
        <p>{{ $t('about.builtWith') }}</p>
      </div>
    </div>
  </div>
</template>

<script>
import i18nMixin from '@/mixins/i18nMixin'

export default {
  name: 'About',
  mixins: [i18nMixin],

  data() {
    return {
      logoPath: require('@/assets/icon.jpg')
    }
  },

  mounted() {
    // Track page view if needed
    console.log('About page viewed')
  }
}
</script>

<style scoped>
.about-page {
  height: 100%;
  overflow-y: auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px;
}

.about-header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInDown 0.5s ease;
}

.logo-section {
  display: inline-block;
  background: white;
  padding: 40px 60px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.logo {
  width: 160px;
  height: 160px;
  border-radius:999px ;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 3s ease-in-out infinite;
}

.logo-image {
  border-radius:999px ;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(59, 130, 246, 0.3));
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.logo-section h1 {
  margin: 0 0 8px;
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.tagline {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 16px;
  font-weight: 500;
  font-style: italic;
}

.version {
  margin: 0;
  padding: 6px 16px;
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.about-content {
  max-width: 1200px;
  margin: 0 auto;
}

.about-content .el-card {
  margin-bottom: 24px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 0.5s ease;
}

.about-content h2 {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-content h2 i {
  color: #667eea;
}

.info-card p {
  font-size: 15px;
  line-height: 1.8;
  color: #475569;
  margin-bottom: 16px;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-item {
  padding: 20px;
  background: #f8fafc;
  border-radius: 12px;
  transition: all 0.3s;
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, #f8fafc 0%, #e9ecef 100%);
}

.feature-item i {
  font-size: 32px;
  color: #667eea;
  margin-bottom: 12px;
}

.feature-item h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
}

.feature-item p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.tech-item {
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tech-item strong {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tech-item span {
  color: #1e293b;
  font-size: 15px;
  font-weight: 500;
}

.shortcuts-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.shortcut-item kbd {
  padding: 4px 8px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #1e293b;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.shortcut-item span {
  flex: 1;
  color: #475569;
  font-size: 14px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  text-decoration: none;
  color: #1e293b;
  transition: all 0.3s;
}

.link-item:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.link-item i {
  font-size: 20px;
  color: #667eea;
}

.link-item:hover i {
  color: white;
}

.link-item span {
  font-size: 14px;
  font-weight: 500;
}

.footer {
  text-align: center;
  padding: 40px 20px;
  color: white;
}

.footer p {
  margin: 0 0 8px;
  font-size: 14px;
  opacity: 0.9;
}

.footer p:last-child {
  margin: 0;
  font-size: 13px;
  opacity: 0.8;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .about-page {
    padding: 20px;
  }
  
  .logo-section {
    padding: 30px 40px;
  }
  
  .logo-section h1 {
    font-size: 28px;
  }
  
  .features-grid,
  .tech-grid,
  .shortcuts-list,
  .links-grid {
    grid-template-columns: 1fr;
  }
}
</style>